package cn.tedu.wechatdemo.utils;

import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;

import java.io.IOException;

/**
 * @Author: Miyako
 * @Date: 2024-10-15-19:35
 * @Description:发送HTTP请求工具包
 */


public class  HttpRequestUtil {
        public static  HttpResponse doGet(String url){
          HttpClient client = HttpClientBuilder.create().build();
            HttpGet httpGet = new HttpGet(url);
            HttpResponse response = null;
            try {
                 response = client.execute(httpGet);

            } catch (IOException e) {
                throw new RuntimeException(e);
            }
            return response;

        }


}
